﻿using System;
using System.Threading.Tasks;
using System.Timers;
using static System.Console;

namespace BaseSyntax.Event
{
	public class TimerEvent:ITest
	{
		private int counter = 0;

		public void WriteChar(object source, ElapsedEventArgs e)
		{
			Console.WriteLine($"{counter ++}");
		}
		public void Test()
		{
			Timer tmr = new Timer(200);
			// tmr.Elapsed += WriteChar;
			tmr.Elapsed += new ElapsedEventHandler(WriteChar);
			tmr.Start();
			System.Threading.Thread.Sleep(3000);
			ReadKey();
		}
	}
}